package algorithm.poj.p1000;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLDecoder;
import java.util.StringTokenizer;

/**
 * 分析：
 * 实现：
 * 经验：
 * 教训：
 * 
 * @author wong.tong@gmail.com
 *
 */
public class P1189 {

	public static void main(String[] args) throws Exception {

		InputStream input = null;
		if (false) {
			input = System.in;
		} else {
			URL url = P1189.class.getResource("P1189.txt");
			File file = new File(URLDecoder.decode(url.getPath(), "UTF-8"));
			input = new FileInputStream(file);
		}
		
		BufferedReader stdin = new BufferedReader(new InputStreamReader(input));

		StringTokenizer st = null;
		String line = stdin.readLine();
		st = new StringTokenizer(line);
		int n = Integer.valueOf(st.nextToken());
		int m = Integer.valueOf(st.nextToken());
		boolean[][] a = new boolean[n][];
		for (int i = 0; i < n; i ++) {
			line = stdin.readLine();
			st = new StringTokenizer(line);
			a[i] = new boolean[i+3];
			a[i][0] = a[i][i+2] = false;	//两边各增加一格，可以减少判断次数，简化逻辑，下面的p与此类似
			for (int j = 1; j < a[i].length-1; j ++) {
				a[i][j] = "*".equals(st.nextToken());
			}
		}
		
		long r = f(n, m, a);
		if (r == 0) {
			System.out.println("0/1");
		} else {
			int c = 0;
			while (r%2 == 0) {
				r /= 2;
				c ++;
			}
			long s = 1L<<(n+1-c);
			System.out.println(r + "/" + s);
		}
	}

	private static long f(int n, int m, boolean[][] a) {
		
		long[][] p = new long[n][];
		for (int i = 0; i < n; i ++) {
			if (i == 0) {
				if (a[i][1]) {
					p[i] = new long[] {0,1,0,1,0};
				} else {
					p[i] = new long[] {0,0,2,0,0};
				}
			} else {
				p[i] = new long[2*i+5];	
				p[i][0] = p[i][2*i+4] = 0L;
				for (int j = 1; j < p[i].length-1; j ++) {
					if (j%2 == 0) {
						if (!a[i][j/2]) {
							p[i][j] = p[i-1][j-1]<<1;
						}
					} else {
						p[i][j] = p[i-1][j-1]<<1;
						if (a[i][j/2]) {
							p[i][j]  += p[i-1][j-2];
						}
						if (a[i][j/2+1]) {
							p[i][j] += p[i-1][j];
						}
					}
				}
			}
		}
		
		long r = p[n-1][2*m+1]<<1;
		if (a[n-1][m]) {
			r += p[n-1][2*m];
		}
		if (a[n-1][m+1]) {
			r += p[n-1][2*m+2];
		}
		return r;
	}
}